package com.yiqi.liebang.common.widget;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yiqi.liebang.R;
import com.yiqi.liebang.common.widget.dialog.BaseDialog;
import com.yiqi.liebang.common.widget.dialog.BounceBottomEnter;
import com.yiqi.liebang.common.widget.dialog.CornerUtils;
import com.yiqi.liebang.common.widget.dialog.SlideTopExit;
import com.yiqi.liebang.common.widget.dialog.Swing;
import com.yiqi.liebang.common.widget.dialog.ZoomOutExit;
import com.yiqi.liebang.feature.home.view.AskActivity;
import com.yiqi.liebang.feature.people.view.PeopleActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HomeDialog extends BaseDialog<HomeDialog> {
    @BindView(R.id.btn_home_dialog_tiwen)
    TextView mTvCancel;
    @BindView(R.id.btn_home_dialog_add)
    TextView mTvExit;
    @BindView(R.id.btn_dialog_close)
    ImageView mTvClose;

    public HomeDialog(Context context) {
        super(context);
    }

    @Override
    public View onCreateView() {
//        widthScale(0.85f);
        showAnim(new BounceBottomEnter());
        dismissAnim(new SlideTopExit());
        View inflate = View.inflate(mContext, R.layout.dialog_home, null);
        ButterKnife.bind(this, inflate);
//        inflate.setBackgroundDrawable(
//                CornerUtils.cornerDrawable(Color.parseColor("#ffffff"), dp2px(5)));
        setCanceledOnTouchOutside(false);
        return inflate;
    }

    @Override
    public void setUiBeforShow() {
        mTvCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, AskActivity.class);
                mContext.startActivity(intent);
                dismiss();
            }
        });
        mTvExit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, PeopleActivity.class);
                mContext.startActivity(intent);
                dismiss();
            }
        });
        mTvClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}